package com.sugar.follow.up.module.business.dal.mysql.questionnairetemplate;

import java.util.*;

import com.sugar.follow.up.framework.common.pojo.PageResult;
import com.sugar.follow.up.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.sugar.follow.up.framework.mybatis.core.mapper.BaseMapperX;
import com.sugar.follow.up.module.business.dal.dataobject.questionnairetemplate.QuestionnaireTemplateDO;
import org.apache.ibatis.annotations.Mapper;
import com.sugar.follow.up.module.business.controller.admin.questionnairetemplate.vo.*;

/**
 * 问卷模板 Mapper
 *
 * @author Ysugar
 */
@Mapper
public interface QuestionnaireTemplateMapper extends BaseMapperX<QuestionnaireTemplateDO> {

    default PageResult<QuestionnaireTemplateDO> selectPage(QuestionnaireTemplatePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<QuestionnaireTemplateDO>()
                .eqIfPresent(QuestionnaireTemplateDO::getTitle, reqVO.getTitle())
                .betweenIfPresent(QuestionnaireTemplateDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(QuestionnaireTemplateDO::getId));
    }

}